<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets" template="/templates/templatePadrao.xhtml">
	<ui:define name="conteudo">
		<h:form id="formListEquipes">	
			
			<p:panel id="panel" header="#{language.painel_header_equipe_consultar}" footer="#{language.painel_footer}">
			<center id="center">					
				<h:panelGrid columns="2">
				
					<h:outputLabel value="#{language.equipe_nome}" for="nome" />
					<h:inputText id="nome" value="#{equipeManager.equipe.nome}" />				
											
				</h:panelGrid>
				<br/>
				<p:commandButton action="#{equipeManager.pesquisar()}" value="#{language.actions_buttons_pesquisa}" ajax="false" />
				<p:commandButton action="home" value="#{language.actions_buttons_cancelar}" ajax="false"/>
				<br/>
				<f:verbatim rendered="#{not empty equipeManager.equipes}">
					<br/><br/><br/>
				</f:verbatim>
				
				<p:dataTable id="dataTable" var="equipe" value="#{equipeManager.equipes}"  paginator="true" rows="5" 
	                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}" emptyMessage="#{language.lista_vazia}">  
	                 
			        <!-- <f:facet name="header">  
			            Lista de Equipes  
			        </f:facet>  -->  
			  
			        <p:column style="text-align: center;" >  
			            <f:facet name="header">  
			                <h:outputText value="Equipe" />  
			            </f:facet>  
			            <h:outputText value="#{equipe.nome}" />  
			        </p:column>		
			        
			        <p:column style="width: 12%; text-align: center;"> 
			       		<f:facet name="header">  
			                <h:outputText value="Manter Alunos" />  
			            </f:facet>   
			            <h:commandButton image="/images/icons/recicla.png" title="Manter Alunos" action="#{equipeManager.preparaMembros()}" ajax="false" 
			            	style="background-position: right 2px; padding-right:2px;height : 24px; width : 24px;">  
                            <f:setPropertyActionListener value="#{equipe}"  
                                target="#{equipeManager.equipe}"/>  
                        </h:commandButton>   
			        </p:column>    
			        
			        <p:column style="width: 12%; text-align: center;"> 
			       		<f:facet name="header">  
			                <h:outputText value="Manter Entregas" />  
			            </f:facet>   
			            <h:commandButton image="/images/icons/adicionar.png" title="Manter Entregas" action="#{entregaManager.preparaPesquisar()}" ajax="false" 
			            	style="background-position: right 2px; padding-right:2px;height : 24px; width : 24px;">  
                            <f:setPropertyActionListener value="#{equipe}"  
                                target="#{entregaManager.equipe}"/>  
                        </h:commandButton>   
			        </p:column>   
			       	  
			       <p:column style="width: 12%; text-align: center;"> 
			       		<f:facet name="header">  
			                <h:outputText value="Atualizar" />  
			            </f:facet>   
			            <h:commandButton image="/images/icons/editar.png" title="Atualizar" action="#{equipeManager.preparaAtualizar()}" ajax="false" 
			            	style="background-position: right 2px; padding-right:2px;height : 24px; width : 24px;">  
                            <f:setPropertyActionListener value="#{equipe}"  
                                target="#{equipeManager.equipe}"/>  
                        </h:commandButton>   
			        </p:column>
			        
			        <p:column style="width: 12%; text-align: center;"> 
			       		<f:facet name="header">  
			                <h:outputText value="Excluir" />  
			            </f:facet>   
			            <h:commandButton image="/images/icons/excluir.png" title="Excluir" ajax="false" 
			            	style="background-position: right 2px; padding-right:2px;height : 24px; width : 24px;" 
			            	onclick="if (!confirm('Deseja realmente excluir este registro?')) return false" action="#{equipeManager.excluir()}">  
                            <f:setPropertyActionListener value="#{equipe}"  
                                target="#{equipeManager.equipe}"/>  
                        </h:commandButton>   
			        </p:column>
			         
			    </p:dataTable>  
			    
			    <br/>
			    <p:commandButton action="#{equipeManager.preparaInserir()}" value="#{language.actions_buttons_inserir}" styleClass="button" ajax="false"/>
			    
			</center>
									
			</p:panel>
		</h:form>
		
	</ui:define>
</ui:composition>	
